import sqlalchemy as sa

from like.models.base import Base


class HpRules(Base):
    """首页规则实体"""
    __tablename__ = 'hp_rules'
    __table_args__ = {
        'mysql_engine': 'InnoDB',
        'mysql_charset': 'utf8mb4',
        'mysql_collate': 'utf8mb4_general_ci',
        'mysql_row_format': 'Dynamic',
        'comment': '首页规则表',
    }
    id = sa.Column(sa.Integer(), primary_key=True)  # 主键
    sequence = sa.Column(sa.Integer())  # 序号
    sub_sequence = sa.Column(sa.Integer())  # 子序号
    category_id = sa.Column(sa.Integer())  # 规则类别
    types_id = sa.Column(sa.Integer())  # 规则形式
    source_id = sa.Column(sa.Integer())  # 规则来源
    short_content = sa.Column(sa.String())  # 规则内容
    comment = sa.Column(sa.String())  # 注释
    regex = sa.Column(sa.String())  # 正则表达式
    create_time = sa.Column(sa.Integer())  # 创建时间
    update_time = sa.Column(sa.Integer())  # 更新时间
    delete_time = sa.Column(sa.Integer())  # 删除时间


hp_rules = HpRules.__table__
